#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
//stupid
int main()
{
    int n, i, j;
    int sum = 0;
    int arr[10][10] = { 0 };
    scanf("%d", &n);
    for (i = 0; i < n; i++)
    {
        for (j = 0; j < n; j++)
        {
            scanf("%d", &arr[i][j]);
            sum += arr[i][j];
        }
    }
    for (i = 0, j = n - 1; i < n; i++)
    {
        sum -= arr[i][j];
    }
    for (i = n - 1, j = 0; j < n; j++)
    {
        sum -= arr[i][j];
    }
    for (i = 0, j = n - 1; i < n, j >= 0; i++, j--)
    {
        sum -= arr[i][j];
    }
    sum = sum + arr[n - 1][n - 1] + arr[0][n - 1] + arr[n - 1][0];
    printf("%d", sum);
    return 0;
}